<template>
    <div>
        <h1>{{ msg }}</h1>
        <button @click="sendToChild1">给child1发消息</button>
    </div>
</template>

<script>
    export default {
        name:"Child2",
        props:{
            msg:String
        },
        methods: {
            sendToChild1() {
                console.log('child2', 'start send msg to child1');
                this.$bus.$emit('event-from-child2', 'some msg from child2')
            }
        },
    }
</script>

<style lang="scss" scoped>

</style>